package com.yisu.expressway.api.core.service.impl;

import com.yisu.expressway.api.core.mapper.CategoryBannerMapper;
import com.yisu.expressway.api.core.mapper.GoodsArchivesMapper;
import com.yisu.expressway.api.core.service.IModuleService;
import com.yisu.expressway.api.domain.request.ModuleDataRequest;
import com.yisu.expressway.api.domain.vo.CategoryBannerVo;
import com.yisu.expressway.api.domain.vo.CategoryGoodsVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by xlt on 2017/4/29.
 */
@Service
public class ModuleServiceImpl implements IModuleService {
    @Resource
    private CategoryBannerMapper categoryBannerMapper;
    @Resource
    private GoodsArchivesMapper goodsArchivesMapper;
    @Override
    public List<CategoryBannerVo> getCategoryBannerByCategoryCode(String categoryCode) {
        return categoryBannerMapper.getCategoryBannerByCategoryCode(categoryCode);
    }

    /**
     * 通过分类获取分类推荐商品列表
     *
     * @param moduleDataRequest 分类编号
     * @return 分类列表
     */
    @Override
    public List<CategoryGoodsVo> getRecommendGoodsGoodsArchivesByCategoryCode(ModuleDataRequest moduleDataRequest) {
        return goodsArchivesMapper.getRecommendGoodsGoodsArchivesByCategoryCode(moduleDataRequest);
    }
}
